<?php

namespace Controller\Options;

class Setting extends \Controller\Base {

	public function actionIndex() {
		$this->setMenuPath('Options', 'Setting');
		$op = \Data\Options::instance()->get();
		if ($this->isPost()) {
			$op = array(
				'WebDesc' => $this->postParam('desc'),
				'Address' => $this->postParam('address'),
				'Phone' => $this->postParam('phone'),
				'Email' => $this->postParam('email'),
			);
			\Data\Options::instance()->save($op);
			$this->addSuccessMsg('基本信息设置成功');
		}
		if (!$op) {
			$op = array(
				'WebDesc' => '',
				'Address' => '',
				'Phone' => '',
				'Email' => '',
			);
		}
		$this->assign('op', $op);
		$this->display();
	}

}